package com.luxury.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.luxury.HomeWebActivity;
import com.luxury.activity.AllOrderActivity;
import com.luxury.activity.InformationActivity;
import com.luxury.R;
import com.luxury.activity.MycollectionActivity;
import com.luxury.activity.RefundActivity;
import com.luxury.activity.WaitCommentActivity;
import com.luxury.activity.WaitPayActivity;
import com.luxury.activity.WaitSignActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2016/12/5.
 */

public class MineFragment extends Fragment {
    @BindView(R.id.image_headImg_mine)
    ImageView imageHeadImgMine;
    @BindView(R.id.linear_all_order_mine)
    LinearLayout linearAllOrderMine;
    @BindView(R.id.tv_mine_wait_pay)
    TextView tvMineWaitPay;
    @BindView(R.id.tv_mine_wait_sign)
    TextView tvMineWaitSign;
    @BindView(R.id.tv_mine_refund)
    TextView tvMineRefund;
    @BindView(R.id.tv_mine_comment)
    TextView tvMineComment;
    @BindView(R.id.linear_coupon_mine)
    LinearLayout linearCouponMine;
    @BindView(R.id.linear_secoocoin_mine)
    LinearLayout linearSecoocoinMine;
    @BindView(R.id.linear_paimai_mine)
    LinearLayout linearPaimaiMine;
    @BindView(R.id.linear_address_mine)
    LinearLayout linearAddressMine;
    @BindView(R.id.linear_online_service_mine)
    LinearLayout linearOnlineServiceMine;
    @BindView(R.id.linear_vip_mine)
    LinearLayout linearVipMine;
    @BindView(R.id.linear_comment_return_mine)
    LinearLayout linearCommentReturnMine;
    @BindView(R.id.iv_setting_mine)
    ImageView ivSettingMine;
    @BindView(R.id.iv_massage_mine)
    ImageView ivMassageMine;
    @BindView(R.id.linear_collection_mine)
    LinearLayout linearCollectionMine;
    private Context mContext;
private Intent mIntent;
    public static MineFragment newInstance() {
        Bundle args = new Bundle();
        MineFragment fragment = new MineFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        mContext = context;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable
            Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_mine, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

    @OnClick({R.id.image_headImg_mine, R.id.linear_all_order_mine, R.id.tv_mine_wait_pay, R.id.tv_mine_wait_sign,
            R.id.tv_mine_refund, R.id.tv_mine_comment, R.id.linear_collection_mine, R.id.linear_coupon_mine,
            R.id.linear_secoocoin_mine, R.id.linear_paimai_mine, R.id.linear_address_mine, R.id.linear_online_service_mine,
            R.id.linear_vip_mine, R.id.linear_comment_return_mine, R.id.iv_setting_mine, R.id.iv_massage_mine})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.image_headImg_mine:
                //我的资料
                mIntent = new Intent(mContext, InformationActivity.class);

                startActivity(mIntent);
                break;
            case R.id.linear_all_order_mine:
                //全部订单
                mIntent=new Intent(mContext,AllOrderActivity.class);

                startActivity(mIntent);
                break;
            case R.id.tv_mine_wait_pay:
                //待付款
                mIntent=new Intent(mContext,WaitPayActivity.class);

                startActivity(mIntent);
                break;
            case R.id.tv_mine_wait_sign:
                //待收货
                mIntent=new Intent(mContext,WaitSignActivity.class);

                startActivity(mIntent);
                break;

            case R.id.tv_mine_refund:
                //退货单
                mIntent=new Intent(mContext,RefundActivity.class);

                startActivity(mIntent);
                break;
            case R.id.tv_mine_comment:
                //待评价
                mIntent=new Intent(mContext,WaitCommentActivity.class);

                startActivity(mIntent);
                break;
            case R.id.linear_collection_mine:
                //我的收藏
                mIntent=new Intent(mContext,MycollectionActivity.class);

                startActivity(mIntent);
                break;
            case R.id.linear_coupon_mine:
                //我的优惠券

                break;
            case R.id.linear_secoocoin_mine:
                //我的库币

                break;
            case R.id.linear_paimai_mine:
                //我的拍卖
                mIntent= new Intent(mContext, HomeWebActivity.class);
                mIntent.putExtra("url", "http://android.secoo.com/auctionResultList.html?channel=baiduzhushou");
                startActivity(mIntent);

                break;
            case R.id.linear_address_mine:
                //我的地址

                break;
            case R.id.linear_online_service_mine:
                //寺库客服

                break;
            case R.id.linear_vip_mine:
                //VIP预约回电

                break;
            case R.id.linear_comment_return_mine:
                //意见反馈
                mIntent= new Intent(mContext, HomeWebActivity.class);
                mIntent.putExtra("url", "http://android.secoo.com/appActivity/collectInformation.shtml?channel=baiduzhushou");
                startActivity(mIntent);
                break;
            case R.id.iv_setting_mine:
                //设置

                break;
            case R.id.iv_massage_mine:
                //消息
                mIntent= new Intent(mContext, HomeWebActivity.class);
                mIntent.putExtra("url", "http://android.secoo.com/appActivity/message_center.shtml?pageid=1151");
                startActivity(mIntent);

                break;
        }
    }

}
